 <!-- Table (TABLE) -->
 <div >
      <h3 class="tit">Suggestion box</h3>
      <table>
        <tr>
          <th style="width:200px;">Title</th>
          <th style="width:200px;">Publish</th>
          <th style="width:200px;">Reply/View</th>
          <?php 
				$tmpCI = &get_instance();
				if($tmpCI->session->userdata("usertype")== 4){
			?>
          <th style="width:80px;">Edit</th>
          <th style="width:80px;">Del</th>
          <?php }?>
        </tr>
<?php 
		$i = 0;
		if (isset($list))
		{
        foreach ($list->result_array() as $row)
		{
			?>
		 <tr <?php if ($i%2 == 1)echo 'class="bg"';?>>
			<td>
			<?php 
			echo '<a href="'.base_url("index.php/book/detail/".$row["bookid"]).'/0">'.($row["book_title"]==""?"no title":$row["book_title"])."</a>";
			?>
			</td>
			<td>
			<?php 
			echo $row["name"];
			?><span style="color:#B3B3B3"><?php echo " ".date('Y-m-d H:i:n',$row["add_date"]);?></span>
			</td>
			<td>
			<?php 
			echo $row["reply_num"]==null ?0:$row["reply_num"];
			echo "/";
			echo $row["view"];
			?>
			</td>
			<?php 
				$tmpCI = &get_instance();
				if($tmpCI->session->userdata("usertype")== 4){
			?>
			<td>
			<?php 
			echo '<a href="'.base_url("index.php/book/edit/".$row["bookid"]).'">Edit</a>';
			?>
			</td>
			
			<td>
			<?php 
			echo '<a href="'.base_url("index.php/book/delete/".$row["bookid"]).'">Delete</a>';
			?>
			</td>
			<?php 
				}
			
			?>
			</tr>
			
<?php 
	$i++;
		}
	}
?>

		<tr><td colspan="<?php if($tmpCI->session->userdata("usertype")== 4)
		{
			echo "5";
		}
		else 
		{
			echo "3";
		}
		?>">
			<div class="f-right" >
	      <span style="width:120px;">
	      <?php 
	      
	      	if (isset($start)&&$start>=10)
	      	{
				$prev =$start-10;
				echo '<a href="'.base_url("index.php/book/getbookinfo/".$prev).'">prev page</a>';
	      	}
	      	else
	      	{
	      		echo "prev page";
	      	}
	      ?>
	      </span>
	      <span style="width:120px;"><?php if (isset($start))echo ""+($num == 0?0:(intval($start)/10+1))."/".($num%10==0?$num/10:intval($num/10)+1);?>
	      </span>
	      <span style="width:120px;">
	        <?php 
	      	if (isset($start)&&$start+10<=$num)
	      	{
				$next =$start+10;
				echo '<a href="'.base_url("index.php/book/getbookinfo/".$next).'">next page</a>';
	      	}
	      	else
	      	{
	      		echo "next page";
	      	}
	      ?>
	      </span>
	      </div>
		</td></tr>
      </table>
      
 </div>
      